//
//  ALSLeftBarButton.m
//  ALS3.0
//
//  Created by guomianxiang on 17/3/15.
//  Copyright © 2017年 guomianxiang. All rights reserved.
//

#import "ALSBarButton.h"

@implementation ALSBarButton

+ (UIButton *)backButtonWithTitle:(NSString *)title {
    if (title == nil) {
        title = @"返回";
    }
    UIButton *back = [[UIButton alloc]init];
    back.titleEdgeInsets = UIEdgeInsetsMake(0, -6, 0, 0);
    back.imageEdgeInsets = UIEdgeInsetsMake(0, -16, 0, 0);
    [back setImage:[UIImage imageNamed:@"ARROW---LEFT"] forState:(UIControlStateNormal)];
    [back setImage:[UIImage imageNamed:@"ARROW---LEFT-in"] forState:(UIControlStateHighlighted)];
    [back setTitle:title forState:(UIControlStateNormal)];
    [back setTitleColor:[UIColor colorWithRed:0.000 green:0.945 blue:0.941 alpha:1.00] forState:(UIControlStateHighlighted)];
    [back sizeToFit];
    return back;
}

+ (UIButton *)normalButtonWithNormalTitle:(NSString *)normalTitle selectedTitle:(NSString *)selectedTitle highlightTitle:(NSString *)highlightTitle {
    UIButton *button = [[UIButton alloc]init];
    
    [button setTitle:normalTitle forState:(UIControlStateNormal)];
    [button setTitle:selectedTitle forState:(UIControlStateSelected)];
    [button setTitle:highlightTitle forState:(UIControlStateHighlighted)];

    [button setTitleColor:[UIColor colorWithRed:0.000 green:0.945 blue:0.941 alpha:1.00] forState:(UIControlStateSelected)];
    [button setTitleColor:[UIColor colorWithRed:0.000 green:0.945 blue:0.941 alpha:1.00] forState:(UIControlStateHighlighted)];

    [button sizeToFit];
    return button;
}

+ (UIButton *)normalButtonWithNormalTitle:(NSString *)normalTitle andNormalImageName:(NSString *)normalImageName selectedTitle:(NSString *)selectedTitle andSelectedImageName:(NSString *)selectedImageName highlightTitle:(NSString *)highlightTitle andHighlightImageName:(NSString *)highlightImageName {
    UIButton *button = [[UIButton alloc]init];
    
    [button setTitle:normalTitle forState:(UIControlStateNormal)];
    [button setImage:[UIImage imageNamed:normalImageName] forState:(UIControlStateNormal)];
    
    [button setTitle:selectedTitle forState:(UIControlStateSelected)];
    [button setImage:[UIImage imageNamed:selectedImageName] forState:(UIControlStateSelected)];

    [button setTitle:highlightTitle forState:(UIControlStateHighlighted)];
    [button setImage:[UIImage imageNamed:highlightImageName] forState:(UIControlStateHighlighted)];

    [button setTitleColor:[UIColor colorWithRed:0.000 green:0.945 blue:0.941 alpha:1.00] forState:(UIControlStateSelected)];
    [button setTitleColor:[UIColor colorWithRed:0.000 green:0.945 blue:0.941 alpha:1.00] forState:(UIControlStateHighlighted)];
    
    [button sizeToFit];
    return button;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
